const varObj: any = {
    throttleLastTimer: 0
}

// 功能节流
const throttle = function (callback: Function, arr: any) {
    // 当前操作时间戳
    let nowTimer: number = new Date().getTime();
    // 间隔操作大于500ms才进行后续操作
    if (nowTimer - varObj.throttleLastTimer >= 1000) {
        callback(arr);
        varObj.throttleLastTimer = nowTimer;
    }

}

export {
    throttle
}